package com.shopng.server.commands;

import java.util.Properties;

import org.apache.geode.cache.CacheFactory;
import org.apache.geode.cache.DataPolicy;
import org.apache.geode.cache.Declarable;
import org.apache.geode.cache.RegionFactory;
import org.apache.geode.cache.lucene.LuceneService;
import org.apache.geode.cache.lucene.LuceneServiceProvider;
import org.apache.geode.cache.lucene.internal.LuceneServiceImpl;
import org.apache.geode.cache.lucene.internal.management.LuceneIndexMetrics;
import org.apache.geode.internal.cache.GemFireCacheImpl;

import com.shopng.utils.LogUtil;

public class InitBean implements Declarable
{
  public InitBean()
  {
    
  }
  
  @Override
  public void init(Properties props)
  {
    LogUtil.getCoreLog().info("start init");
    GemFireCacheImpl cache = (GemFireCacheImpl)CacheFactory.getAnyInstance();
//    System.out.println(cache.getRegion("/test"));
//    LuceneService ls = LuceneServiceProvider.get(cache);
//    ls.createIndex("test_index", "/test", "name");
//    
//    RegionFactory rf = cache.createRegionFactory();
//    rf.setDataPolicy(DataPolicy.PERSISTENT_PARTITION);
//    rf.setDiskStoreName("_session_");
//    rf.create("/test");
  }

}
